<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="文献类型:期刊|会议|..." prop="bibPaperType">
        <el-select v-model="queryParams.bibPaperType" placeholder="请选择文献类型:期刊|会议|..." clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="出版年" prop="bibYear">
        <el-input
          v-model="queryParams.bibYear"
          placeholder="请输入出版年"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="卷" prop="bibVolum">
        <el-input
          v-model="queryParams.bibVolum"
          placeholder="请输入卷"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="期" prop="bibIssue">
        <el-input
          v-model="queryParams.bibIssue"
          placeholder="请输入期"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="会议日期" prop="bibConfDate">
        <el-input
          v-model="queryParams.bibConfDate"
          placeholder="请输入会议日期"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="出版商" prop="publisher">
        <el-input
          v-model="queryParams.publisher"
          placeholder="请输入出版商"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="页码" prop="bibPages">
        <el-input
          v-model="queryParams.bibPages"
          placeholder="请输入页码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="DOI" prop="doi">
        <el-input
          v-model="queryParams.doi"
          placeholder="请输入DOI"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="ISI收录号" prop="isiAccession">
        <el-input
          v-model="queryParams.isiAccession"
          placeholder="请输入ISI收录号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="EI收录号" prop="eiAccession">
        <el-input
          v-model="queryParams.eiAccession"
          placeholder="请输入EI收录号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="CSCD收录号" prop="cscdAccession">
        <el-input
          v-model="queryParams.cscdAccession"
          placeholder="请输入CSCD收录号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="中文通迅作者" prop="corAuthorCn">
        <el-input
          v-model="queryParams.corAuthorCn"
          placeholder="请输入中文通迅作者"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="英文通迅作者" prop="corAuthorEn">
        <el-input
          v-model="queryParams.corAuthorEn"
          placeholder="请输入英文通迅作者"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="IDS 号" prop="ids">
        <el-input
          v-model="queryParams.ids"
          placeholder="请输入IDS 号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="ISSN" prop="issn">
        <el-input
          v-model="queryParams.issn"
          placeholder="请输入ISSN"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="电子ISSN" prop="eissn">
        <el-input
          v-model="queryParams.eissn"
          placeholder="请输入电子ISSN"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="ISBN" prop="isbn">
        <el-input
          v-model="queryParams.isbn"
          placeholder="请输入ISBN"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="语言类型" prop="language">
        <el-input
          v-model="queryParams.language"
          placeholder="请输入语言类型"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否VIP收录，0为否，1为是,2为待定" prop="beVip">
        <el-input
          v-model="queryParams.beVip"
          placeholder="请输入是否VIP收录，0为否，1为是,2为待定"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否Wanfang收录，0为否，1为是,2为待定" prop="beWanfang">
        <el-input
          v-model="queryParams.beWanfang"
          placeholder="请输入是否Wanfang收录，0为否，1为是,2为待定"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否CNKI收录，0为否，1为是,2为待定" prop="beCnki">
        <el-input
          v-model="queryParams.beCnki"
          placeholder="请输入是否CNKI收录，0为否，1为是,2为待定"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否SCI收录，0为否，1为是,2为待定" prop="beSci">
        <el-input
          v-model="queryParams.beSci"
          placeholder="请输入是否SCI收录，0为否，1为是,2为待定"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否SSCI收录，0为否，1为是,2为待定" prop="beSsci">
        <el-input
          v-model="queryParams.beSsci"
          placeholder="请输入是否SSCI收录，0为否，1为是,2为待定"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否CPCI收录，0为否，1为是,2为待定" prop="beCpci">
        <el-input
          v-model="queryParams.beCpci"
          placeholder="请输入是否CPCI收录，0为否，1为是,2为待定"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否EI收录，0为否，1为是,2为待定" prop="beEi">
        <el-input
          v-model="queryParams.beEi"
          placeholder="请输入是否EI收录，0为否，1为是,2为待定"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否CSCD收录，0为否，1为是,2为待定" prop="beCscd">
        <el-input
          v-model="queryParams.beCscd"
          placeholder="请输入是否CSCD收录，0为否，1为是,2为待定"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否WOS收录，0为否，1为是,2为待定" prop="beWos">
        <el-input
          v-model="queryParams.beWos"
          placeholder="请输入是否WOS收录，0为否，1为是,2为待定"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="createDate">
        <el-date-picker clearable size="small"
          v-model="queryParams.createDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择创建时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="页数" prop="totalPages">
        <el-input
          v-model="queryParams.totalPages"
          placeholder="请输入页数"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['intelligence:bibinfo:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['intelligence:bibinfo:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['intelligence:bibinfo:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          :loading="exportLoading"
          @click="handleExport"
          v-hasPermi="['intelligence:bibinfo:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="bibinfoList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="索引ID" align="center" prop="bibId" />
      <el-table-column label="被检索者ID" align="center" prop="expId" />
      <el-table-column label="文献类型:期刊|会议|..." align="center" prop="bibPaperType" />
      <el-table-column label="中文作者" align="center" prop="bibAuthorCn" />
      <el-table-column label="英文作者" align="center" prop="bibAuthorEn" />
      <el-table-column label="中文标题" align="center" prop="bibTitleCn" />
      <el-table-column label="英文标题" align="center" prop="bibTitleEn" />
      <el-table-column label="中文来源出版物" align="center" prop="bibSourceCn" />
      <el-table-column label="英文来源出版物" align="center" prop="bibSourceEn" />
      <el-table-column label="中文作者单位" align="center" prop="bibAffiCn" />
      <el-table-column label="英文作者单位" align="center" prop="bibAffiEn" />
      <el-table-column label="出版年" align="center" prop="bibYear" />
      <el-table-column label="卷" align="center" prop="bibVolum" />
      <el-table-column label="期" align="center" prop="bibIssue" />
      <el-table-column label="中文会议名称" align="center" prop="bibConfNameEn" />
      <el-table-column label="英文会议名称" align="center" prop="bibConfNameCn" />
      <el-table-column label="中文会议地址" align="center" prop="bibConfAddrEn" />
      <el-table-column label="英文会议地址" align="center" prop="bibConfAddrCn" />
      <el-table-column label="会议日期" align="center" prop="bibConfDate" />
      <el-table-column label="赞助者" align="center" prop="bibConfSponsor" />
      <el-table-column label="出版商" align="center" prop="publisher" />
      <el-table-column label="页码" align="center" prop="bibPages" />
      <el-table-column label="中文关键词" align="center" prop="keywordsCn" />
      <el-table-column label="英文关键词" align="center" prop="keywordsEn" />
      <el-table-column label="中文摘要" align="center" prop="abstractCn" />
      <el-table-column label="英文摘要" align="center" prop="abstractEn" />
      <el-table-column label="DOI" align="center" prop="doi" />
      <el-table-column label="Web of Science 核心合集中的 "被引频次"" align="center" prop="isiTtc" />
      <el-table-column label="在中国科学引文数据库中的被引频次" align="center" prop="cscdTtc" />
      <el-table-column label="ISI收录号" align="center" prop="isiAccession" />
      <el-table-column label="EI收录号" align="center" prop="eiAccession" />
      <el-table-column label="CSCD收录号" align="center" prop="cscdAccession" />
      <el-table-column label="中文通迅作者" align="center" prop="corAuthorCn" />
      <el-table-column label="英文通迅作者" align="center" prop="corAuthorEn" />
      <el-table-column label="中文通讯作者地址" align="center" prop="corAuthorAddressCn" />
      <el-table-column label="英文通讯作者地址" align="center" prop="corAuthorAddressEn" />
      <el-table-column label="邮箱" align="center" prop="emailAddress" />
      <el-table-column label="IDS 号" align="center" prop="ids" />
      <el-table-column label="ISSN" align="center" prop="issn" />
      <el-table-column label="电子ISSN" align="center" prop="eissn" />
      <el-table-column label="ISBN" align="center" prop="isbn" />
      <el-table-column label="基金支持" align="center" prop="fund" />
      <el-table-column label="语言类型" align="center" prop="language" />
      <el-table-column label="是否VIP收录，0为否，1为是,2为待定" align="center" prop="beVip" />
      <el-table-column label="是否Wanfang收录，0为否，1为是,2为待定" align="center" prop="beWanfang" />
      <el-table-column label="是否CNKI收录，0为否，1为是,2为待定" align="center" prop="beCnki" />
      <el-table-column label="是否SCI收录，0为否，1为是,2为待定" align="center" prop="beSci" />
      <el-table-column label="是否SSCI收录，0为否，1为是,2为待定" align="center" prop="beSsci" />
      <el-table-column label="是否CPCI收录，0为否，1为是,2为待定" align="center" prop="beCpci" />
      <el-table-column label="是否EI收录，0为否，1为是,2为待定" align="center" prop="beEi" />
      <el-table-column label="是否CSCD收录，0为否，1为是,2为待定" align="center" prop="beCscd" />
      <el-table-column label="是否WOS收录，0为否，1为是,2为待定" align="center" prop="beWos" />
      <el-table-column label="全文链接" align="center" prop="download" />
      <el-table-column label="创建时间" align="center" prop="createDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="页数" align="center" prop="totalPages" />
      <el-table-column label="主题词" align="center" prop="suCategory" />
      <el-table-column label="学科类别" align="center" prop="scCategory" />
      <el-table-column label="主题词" align="center" prop="wcCategory" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['intelligence:bibinfo:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['intelligence:bibinfo:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改文献对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="文献类型:期刊|会议|..." prop="bibPaperType">
          <el-select v-model="form.bibPaperType" placeholder="请选择文献类型:期刊|会议|...">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="中文作者" prop="bibAuthorCn">
          <el-input v-model="form.bibAuthorCn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="英文作者" prop="bibAuthorEn">
          <el-input v-model="form.bibAuthorEn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="中文标题" prop="bibTitleCn">
          <el-input v-model="form.bibTitleCn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="英文标题" prop="bibTitleEn">
          <el-input v-model="form.bibTitleEn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="中文来源出版物" prop="bibSourceCn">
          <el-input v-model="form.bibSourceCn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="英文来源出版物" prop="bibSourceEn">
          <el-input v-model="form.bibSourceEn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="中文作者单位" prop="bibAffiCn">
          <el-input v-model="form.bibAffiCn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="英文作者单位" prop="bibAffiEn">
          <el-input v-model="form.bibAffiEn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="出版年" prop="bibYear">
          <el-input v-model="form.bibYear" placeholder="请输入出版年" />
        </el-form-item>
        <el-form-item label="卷" prop="bibVolum">
          <el-input v-model="form.bibVolum" placeholder="请输入卷" />
        </el-form-item>
        <el-form-item label="期" prop="bibIssue">
          <el-input v-model="form.bibIssue" placeholder="请输入期" />
        </el-form-item>
        <el-form-item label="中文会议名称" prop="bibConfNameEn">
          <el-input v-model="form.bibConfNameEn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="英文会议名称" prop="bibConfNameCn">
          <el-input v-model="form.bibConfNameCn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="中文会议地址" prop="bibConfAddrEn">
          <el-input v-model="form.bibConfAddrEn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="英文会议地址" prop="bibConfAddrCn">
          <el-input v-model="form.bibConfAddrCn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="会议日期" prop="bibConfDate">
          <el-input v-model="form.bibConfDate" placeholder="请输入会议日期" />
        </el-form-item>
        <el-form-item label="赞助者" prop="bibConfSponsor">
          <el-input v-model="form.bibConfSponsor" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="出版商" prop="publisher">
          <el-input v-model="form.publisher" placeholder="请输入出版商" />
        </el-form-item>
        <el-form-item label="页码" prop="bibPages">
          <el-input v-model="form.bibPages" placeholder="请输入页码" />
        </el-form-item>
        <el-form-item label="中文关键词" prop="keywordsCn">
          <el-input v-model="form.keywordsCn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="英文关键词" prop="keywordsEn">
          <el-input v-model="form.keywordsEn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="中文摘要" prop="abstractCn">
          <el-input v-model="form.abstractCn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="英文摘要" prop="abstractEn">
          <el-input v-model="form.abstractEn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="DOI" prop="doi">
          <el-input v-model="form.doi" placeholder="请输入DOI" />
        </el-form-item>
        <el-form-item label="ISI收录号" prop="isiAccession">
          <el-input v-model="form.isiAccession" placeholder="请输入ISI收录号" />
        </el-form-item>
        <el-form-item label="EI收录号" prop="eiAccession">
          <el-input v-model="form.eiAccession" placeholder="请输入EI收录号" />
        </el-form-item>
        <el-form-item label="CSCD收录号" prop="cscdAccession">
          <el-input v-model="form.cscdAccession" placeholder="请输入CSCD收录号" />
        </el-form-item>
        <el-form-item label="中文通迅作者" prop="corAuthorCn">
          <el-input v-model="form.corAuthorCn" placeholder="请输入中文通迅作者" />
        </el-form-item>
        <el-form-item label="英文通迅作者" prop="corAuthorEn">
          <el-input v-model="form.corAuthorEn" placeholder="请输入英文通迅作者" />
        </el-form-item>
        <el-form-item label="中文通讯作者地址" prop="corAuthorAddressCn">
          <el-input v-model="form.corAuthorAddressCn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="英文通讯作者地址" prop="corAuthorAddressEn">
          <el-input v-model="form.corAuthorAddressEn" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="邮箱" prop="emailAddress">
          <el-input v-model="form.emailAddress" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="IDS 号" prop="ids">
          <el-input v-model="form.ids" placeholder="请输入IDS 号" />
        </el-form-item>
        <el-form-item label="ISSN" prop="issn">
          <el-input v-model="form.issn" placeholder="请输入ISSN" />
        </el-form-item>
        <el-form-item label="电子ISSN" prop="eissn">
          <el-input v-model="form.eissn" placeholder="请输入电子ISSN" />
        </el-form-item>
        <el-form-item label="ISBN" prop="isbn">
          <el-input v-model="form.isbn" placeholder="请输入ISBN" />
        </el-form-item>
        <el-form-item label="基金支持" prop="fund">
          <el-input v-model="form.fund" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="语言类型" prop="language">
          <el-input v-model="form.language" placeholder="请输入语言类型" />
        </el-form-item>
        <el-form-item label="是否VIP收录，0为否，1为是,2为待定" prop="beVip">
          <el-input v-model="form.beVip" placeholder="请输入是否VIP收录，0为否，1为是,2为待定" />
        </el-form-item>
        <el-form-item label="是否Wanfang收录，0为否，1为是,2为待定" prop="beWanfang">
          <el-input v-model="form.beWanfang" placeholder="请输入是否Wanfang收录，0为否，1为是,2为待定" />
        </el-form-item>
        <el-form-item label="是否CNKI收录，0为否，1为是,2为待定" prop="beCnki">
          <el-input v-model="form.beCnki" placeholder="请输入是否CNKI收录，0为否，1为是,2为待定" />
        </el-form-item>
        <el-form-item label="是否SCI收录，0为否，1为是,2为待定" prop="beSci">
          <el-input v-model="form.beSci" placeholder="请输入是否SCI收录，0为否，1为是,2为待定" />
        </el-form-item>
        <el-form-item label="是否SSCI收录，0为否，1为是,2为待定" prop="beSsci">
          <el-input v-model="form.beSsci" placeholder="请输入是否SSCI收录，0为否，1为是,2为待定" />
        </el-form-item>
        <el-form-item label="是否CPCI收录，0为否，1为是,2为待定" prop="beCpci">
          <el-input v-model="form.beCpci" placeholder="请输入是否CPCI收录，0为否，1为是,2为待定" />
        </el-form-item>
        <el-form-item label="是否EI收录，0为否，1为是,2为待定" prop="beEi">
          <el-input v-model="form.beEi" placeholder="请输入是否EI收录，0为否，1为是,2为待定" />
        </el-form-item>
        <el-form-item label="是否CSCD收录，0为否，1为是,2为待定" prop="beCscd">
          <el-input v-model="form.beCscd" placeholder="请输入是否CSCD收录，0为否，1为是,2为待定" />
        </el-form-item>
        <el-form-item label="是否WOS收录，0为否，1为是,2为待定" prop="beWos">
          <el-input v-model="form.beWos" placeholder="请输入是否WOS收录，0为否，1为是,2为待定" />
        </el-form-item>
        <el-form-item label="全文链接" prop="download">
          <el-input v-model="form.download" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="创建时间" prop="createDate">
          <el-date-picker clearable size="small"
            v-model="form.createDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择创建时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="页数" prop="totalPages">
          <el-input v-model="form.totalPages" placeholder="请输入页数" />
        </el-form-item>
        <el-form-item label="主题词" prop="suCategory">
          <el-input v-model="form.suCategory" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="学科类别" prop="scCategory">
          <el-input v-model="form.scCategory" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="主题词" prop="wcCategory">
          <el-input v-model="form.wcCategory" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listBibinfo, getBibinfo, delBibinfo, addBibinfo, updateBibinfo, exportBibinfo } from "@/api/intelligence/bibinfo";

export default {
  name: "Bibinfo",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 文献表格数据
      bibinfoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        expId: null,
        bibPaperType: null,
        bibAuthorCn: null,
        bibAuthorEn: null,
        bibTitleCn: null,
        bibTitleEn: null,
        bibSourceCn: null,
        bibSourceEn: null,
        bibAffiCn: null,
        bibAffiEn: null,
        bibYear: null,
        bibVolum: null,
        bibIssue: null,
        bibConfNameEn: null,
        bibConfNameCn: null,
        bibConfAddrEn: null,
        bibConfAddrCn: null,
        bibConfDate: null,
        bibConfSponsor: null,
        publisher: null,
        bibPages: null,
        keywordsCn: null,
        keywordsEn: null,
        abstractCn: null,
        abstractEn: null,
        doi: null,
        isiTtc: null,
        cscdTtc: null,
        isiAccession: null,
        eiAccession: null,
        cscdAccession: null,
        corAuthorCn: null,
        corAuthorEn: null,
        corAuthorAddressCn: null,
        corAuthorAddressEn: null,
        emailAddress: null,
        ids: null,
        issn: null,
        eissn: null,
        isbn: null,
        fund: null,
        language: null,
        beVip: null,
        beWanfang: null,
        beCnki: null,
        beSci: null,
        beSsci: null,
        beCpci: null,
        beEi: null,
        beCscd: null,
        beWos: null,
        download: null,
        createDate: null,
        totalPages: null,
        suCategory: null,
        scCategory: null,
        wcCategory: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        expId: [
          { required: true, message: "被检索者ID不能为空", trigger: "blur" }
        ],
        bibPaperType: [
          { required: true, message: "文献类型:期刊|会议|...不能为空", trigger: "change" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询文献列表 */
    getList() {
      this.loading = true;
      listBibinfo(this.queryParams).then(response => {
        this.bibinfoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        bibId: null,
        expId: null,
        bibPaperType: null,
        bibAuthorCn: null,
        bibAuthorEn: null,
        bibTitleCn: null,
        bibTitleEn: null,
        bibSourceCn: null,
        bibSourceEn: null,
        bibAffiCn: null,
        bibAffiEn: null,
        bibYear: null,
        bibVolum: null,
        bibIssue: null,
        bibConfNameEn: null,
        bibConfNameCn: null,
        bibConfAddrEn: null,
        bibConfAddrCn: null,
        bibConfDate: null,
        bibConfSponsor: null,
        publisher: null,
        bibPages: null,
        keywordsCn: null,
        keywordsEn: null,
        abstractCn: null,
        abstractEn: null,
        doi: null,
        isiTtc: null,
        cscdTtc: null,
        isiAccession: null,
        eiAccession: null,
        cscdAccession: null,
        corAuthorCn: null,
        corAuthorEn: null,
        corAuthorAddressCn: null,
        corAuthorAddressEn: null,
        emailAddress: null,
        ids: null,
        issn: null,
        eissn: null,
        isbn: null,
        fund: null,
        language: null,
        beVip: null,
        beWanfang: null,
        beCnki: null,
        beSci: null,
        beSsci: null,
        beCpci: null,
        beEi: null,
        beCscd: null,
        beWos: null,
        download: null,
        createDate: null,
        totalPages: null,
        suCategory: null,
        scCategory: null,
        wcCategory: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.bibId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加文献";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const bibId = row.bibId || this.ids
      getBibinfo(bibId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改文献";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.bibId != null) {
            updateBibinfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addBibinfo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const bibIds = row.bibId || this.ids;
      this.$modal.confirm('是否确认删除文献编号为"' + bibIds + '"的数据项？').then(function() {
        return delBibinfo(bibIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$modal.confirm('是否确认导出所有文献数据项？').then(() => {
        this.exportLoading = true;
        return exportBibinfo(queryParams);
      }).then(response => {
        this.$download.name(response.msg);
        this.exportLoading = false;
      }).catch(() => {});
    }
  }
};
</script>
